package cc.mrbird.febs.moive.controller;


import cc.mrbird.febs.moive.domain.DataTop;
import cc.mrbird.febs.moive.domain.DataTotalDay;
import cc.mrbird.febs.moive.service.DataTotalDayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Validated
@RestController
@RequestMapping("dataTotalDay")
@Api("电影上映总天数")
public class DataTotalDayController {

    @Autowired
    private DataTotalDayService service;
    @GetMapping("/hello")
    public String hello(){
        return "helloworld";
    }



    @GetMapping("/getData")
    @ApiOperation(value = "电影上映总天数top20")
    public List<DataTotalDay> getData() {
        log.info("getData");
        List<DataTotalDay> data =  service.getData();
        return data;
    }

}
